<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/public/header/permissionCommon.jspf" %>
<html>
<head>
    <title>护理设备管理</title>
</head>

<style>
    .layui-form-checkbox span {
        padding: 0 10px;
        height: 15%;
        font-size: 14px;
        border-radius: 2px 0 0 2px;
        background-color: #d2d2d2;
        color: #fff;
        overflow: hidden;
    }
</style>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>

    <!--右侧主体区域-->
    <div class="layui-body">
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li id="deviceLi" class="layui-this">设备档案</li>
                <li id="deviceLogLi">设备发放记录</li>
            </ul>
            <div class="layui-tab-content" style="height: 100px;">
                <div id="deviveDiv" class="layui-tab-item layui-show">
                    <hr class="layui-bg-black"/>
                    <button class="layui-btn layui-btn-normal" onclick="addDevice()">添加设备</button>

                    <!-- 这里就是数据库查询回来的所有用户记录 -->
                    <table id="deviceList" lay-filter="deviceTable"></table>

                    <script type="text/html" id="optBar1">
                        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
                    </script>

                </div>

                <div id="deviceLogDiv" class="layui-tab-item">
                    <form id="deviceLogSearch" class="layui-form layui-form-pane" method="post" action=""
                          style="margin-top: 20px;">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: 8%">护工姓名</label>
                            <div class="layui-input-inline" style="width: 15%">
                                <input id="userName" name="userName" autocomplete="off" class="layui-input"
                                       type="text"/>
                            </div>
                            <button type="reset" class="layui-btn layui-btn-primary" style="width: 6%">重置</button>
                            <button class="layui-btn" lay-submit="" lay-filter="searchSubmit" style="width: 10%"><i
                                    class="layui-icon">&#xe615;</i>快速检索
                            </button>
                        </div>
                    </form>

                    <hr class="layui-bg-black"/>

                    <button class="layui-btn layui-btn-normal" onclick="addDeviceLog()">添加设备发放记录</button>

                    <!-- 这里就是数据库查询回来的所有记录 -->
                    <table id="deviceLog" lay-filter="deviceLogTable"></table>

                    <script type="text/html" id="optBar2">
                        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
                    </script>

                </div>
            </div>
        </div>
    </div>

    <!--添加或编辑设备-->
    <div id="setDevice" class="layer_self_wrap" style="width:500px;display:none;">
        <form id="devForm" class="layui-form layui-form-pane" method="post" action=""
              style="margin-top: 20px;">
            <input id="id" type="hidden" name="id"/>
            <div class="layui-form-item">
                <label class="layui-form-label">设备类型</label>
                <div class="layui-input-inline">
                    <input id="deviceType" name="deviceType" lay-verify="required" autocomplete="off"
                           class="layui-input" type="text"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">设备状态</label>
                <div class="layui-input-inline">
                    <input id="deviceInfo" name="deviceInfo" lay-verify="required" autocomplete="off"
                           class="layui-input" type="text"/>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 10px;">
                    <button class="layui-btn" lay-submit="" lay-filter="devSubmit">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

    <!--添加或编设备发放记录-->
    <div id="setDeviceLog" class="layer_self_wrap" style="width:500px;display:none;">
        <form id="devLogForm" class="layui-form layui-form-pane" method="post" action=""
              style="margin-top: 20px;">
            <input id="pageNum" type="hidden" name="pageNum"/>
            <input id="logId" type="hidden" name="id"/>
            <div class="layui-form-item">
                <label class="layui-form-label">设备编号</label>
                <div class="layui-input-inline">
                    <input id="deviceId" name="deviceId" lay-verify="required" autocomplete="off"
                           class="layui-input" type="text"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">设备类型</label>
                <div class="layui-input-inline">
                    <input id="deviceType_2" name="deviceType" lay-verify="required" autocomplete="off"
                           class="layui-input" type="text"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">设备属性</label>
                <div class="layui-input-inline">
                    <input id="deviceAtt" name="deviceAtt" lay-verify="required" autocomplete="off"
                           class="layui-input" type="text"/>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">分配护工</label>
                <div class="layui-input-block" id="userWechatDiv">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 10px;">
                    <button class="layui-btn" lay-submit="" lay-filter="devLogSubmit">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>

    <!--底部-->
    <div id="footer"></div>
    <%--<script src="${webPath}/js/permission/auth/permList.js"></script>--%>

    <script src="${webPath}/lib/jquery-3.3.1.min.js"></script>
    <script src="${webPath}/js/device/deviceLog.js"></script>
    <script src="${webPath}/js/device/deviceList.js"></script>

    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>

</div>
</body>
</html>



